package com.chenxiao.Decorator;

/**
 * @Author: CX
 * @Date: Created in  2024/04/03 9:36
 * @version: v1.0
 * @Description: TODO 装饰者模型测试类
 **/
public class DecoratorPatternApp {
    public static void main(String[] args) {
        // 初始化的类
        Component component = new ConcreteComponent();

        // 开始装饰了
        ConcreteDecoratorA decoratorA = new ConcreteDecoratorA(component);

        // 新的装饰方式
        ConcreteDecoratorB decoratorB = new ConcreteDecoratorB(component);

      // 调用装饰后的方法
        decoratorA.operation();
        decoratorB.operation();

    }
}
